home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-02-27 | 1.2 KB | 47 lines | [TEXT/SK8 ] |
- /* SK8 © 1997 Apple Computer, Inc.
- This code is protected under the current SK8 License
- See http://sk8.research.apple.com/ for more information
- Apple Research Laboratories
- */
-
-
-
- import java.awt.*;
-
-
- public class newgamebutton extends roundrect {
-
-
-
- //----------------------------------------
- //Handler Definitions:
- //----------------------------------------
-
- //Initialization function
- public newgamebutton() {
- super();
- this.settext("New Game");
- this.setboundsrect(sk8.list(340, 322, 416, 340));
- this.setautohighlight(true);
- }
-
- public Object mousedown ( ) {
- super.mousedown();
- Object curitem;
- collection cardHolderCollection = sk8concentration.cardholder.contents();
- for (visitstate curState = cardHolderCollection.initialvisitstate(); (curState != null); curState = cardHolderCollection.succeedingvisitstate(curState)) {
- curitem = cardHolderCollection.elementatvisitstate(curState);
- if ((curitem instanceof card)) {
- ((actor) curitem).show();
- }
- }
- sk8concentration.distributesounds();
- sk8concentration.player1.setscore(0);
- sk8concentration.player2.setscore(0);
- sk8concentration.board.setcurrentplayer(sk8concentration.player1);
- return null;
- }
-
-
- }
-